package business;

import java.util.ArrayList;
import java.util.Map;

import model.Topics;
import model.Units;
import model.beans.UnidadBean;

public class Unidades {

	
	public static ArrayList list(int int_planEstudio, String str_academy, String str_subject){				
		ArrayList arrL_list = Units.list(int_planEstudio, str_academy, str_subject);
		
		return arrL_list;
	}

	public static int edit(Map map_data){
		return Units.edit(map_data);
	}
	
	public static UnidadBean instance( int int_unitKey, String str_academyCode, String str_subjectCode ){
		return Units.instance(int_unitKey,  str_academyCode, str_subjectCode);
	}
	
	public static int add( Map map_data, int int_planEstudio){
		return Units.add(map_data, int_planEstudio);
	}
	
	public static int delete( int int_unitKey, String str_academy, String str_subject ){
		int int_retVal = 0;
		if( Topics.list(int_unitKey, str_academy, str_subject).size() == 0 ){
			int_retVal = Units.delete(int_unitKey);
		}
		return int_retVal;
	}
}
